今天預估會把Bit-O-Asm系列解決,懇請各位同志努力!
我個人其實把這系列當作assembly language的檢測,看我基本語法過不過關,所以我都會用紙筆算不會進行compile
題目:Bit-O-Asm-3
Not everything in this disassembly listing is optimal.
解題思路:
題目:Bit-O-Asm-4
Don't tell anyone I told you this, but you can solve this problem without understanding the compare/jump relationship.
Of course, if you're really good, you'll only need one attempt to solve this problem.
解題思路:
補充:
cmp a,b的意思是如果
a-b=0 (代表a=b) 則 ZF = 1
a-b>0 (代表a>b) 則 ZF = 0, CF = 0, SF = 1
a-b<0 (代表a<b) 則 ZF = 0, CF = 1, SF = 0
ZF(零標誌位)
CF(進位標誌位)
SF(符號標誌位)
這裡說的比較詳細,但其實在寫的時候,直接寫
cmp a,b
[jg,je,jle...] lable
後記:
各位可以發現這系列其實比較像在檢測大家的組語學習是否紮實,我這部分其實不太好,以前都是看懂一些就好
所以我這次也重新學了一遍(不是不報,時候未到,逃不掉🤣🤣
但這系列其實蠻友善的,但更該把基礎打好喔!!!